//
//  HomeSectionHeader.swift
//  EyeVisionForPatients
//
//  Created by PMC on 2020/3/9.
//  Copyright © 2020 tao Tao. All rights reserved.
//

import UIKit

enum HomeSectionHeaderType {
    case department
    case doctor
    
    var title: String {
        switch self {
        case .department: return "热门科室"
        case .doctor: return "推荐医生"
        }
    }
    
    var moreTitle: String {
        switch self {
        case .department: return "更多"
        case .doctor: return "全部"
        }
    }
}

class HomeSectionHeader: UIView {
    
    @IBOutlet private weak var titleLabel: UILabel! {
        didSet {
            titleLabel.textColor = .textDark
            titleLabel.font = .medium_18
        }
    }

    @IBOutlet private weak var allLabel: UILabel! {
        didSet {
            allLabel.textColor = .textGColor
            allLabel.font = .medium_14
        }
    }
    
    func makeUI(_ target: Any?, action: Selector?, type: HomeSectionHeaderType) {
        titleLabel.text = type.title
        allLabel.text = type.moreTitle
        
        let tap = UITapGestureRecognizer(target: target, action: action)
        addGestureRecognizer(tap)
    }
    
    
}
